package com.student.foodAfter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.student.foodAfter.entity.Changemoney;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ChangemoneyMapper extends BaseMapper<Changemoney> {
    @Select("select sum(addmoney) as summoney,username from changemoney group by username order by summoney desc limit 10;")
    List<Object> getTop10User();

    @Select("select username,sum(addmoney) as summoney from changemoney group by username order by summoney desc limit 10;")
    List<Object> getTop10Money();


}
